package com.example.basictemplate;

import org.andengine.engine.camera.Camera;
import org.andengine.engine.options.EngineOptions;
import org.andengine.engine.options.ScreenOrientation;
import org.andengine.engine.options.WakeLockOptions;
import org.andengine.engine.options.resolutionpolicy.RatioResolutionPolicy;
import org.andengine.entity.scene.Scene;
import org.andengine.ui.activity.BaseGameActivity;

public class GameActivity extends BaseGameActivity {
    
    final int mCameraWidth = 800;  
    final int mCameraHeight = 500;
    public Scene mScene;

           
    
    
    
    
    
            @Override
            public EngineOptions onCreateEngineOptions() {
                    Camera mCamera = new Camera(0, 0, mCameraWidth, mCameraHeight);
                    final EngineOptions engineOptions = new EngineOptions(true, ScreenOrientation.LANDSCAPE_FIXED, new RatioResolutionPolicy(mCameraWidth, mCameraHeight), mCamera);
                                       
                    
                    // It is necessary in a lot of applications to define the following
                    // wake lock options in order to disable the device's display
                    // from turning off during game play due to inactivity
                    engineOptions.setWakeLockOptions(WakeLockOptions.SCREEN_ON);                    
                    
                    
                 // Return the engineOptions object, passing it to the engine
                    return engineOptions;
            }
           
            
            
            
            
            
            @Override
            public void onCreateResources(OnCreateResourcesCallback pOnCreateResourcesCallback) throws Exception {
            	
	            	/* We should notify the pOnCreateResourcesCallback that we've
	            	finished loading all of the necessary resources in our game AFTER
	            	they are loaded. onCreateResourcesFinished() should be the last method called. */            	
                    pOnCreateResourcesCallback.onCreateResourcesFinished();
            }
           
            
            
            
            
            
            @Override
            public void onCreateScene(OnCreateSceneCallback pOnCreateSceneCallback) throws Exception {
                    mScene = new Scene();

                    
                    // Notify the callback that we're finished creating the scene, returning
                    // mScene to the mEngine object (handled automatically)                    
                    pOnCreateSceneCallback.onCreateSceneFinished(mScene);
            }
           
            
            
            
            
            
            @Override
            public void onPopulateScene(Scene pScene, OnPopulateSceneCallback pOnPopulateSceneCallback) throws Exception {

            	
            	
            		// onPopulateSceneFinished(), similar to the resource and scene	callback
            		// methods, should be called once we are finished populating the scene.            	
                    pOnPopulateSceneCallback.onPopulateSceneFinished();
            }
           
}